package com.lzw.breezeNovel.webApp.controller.video;

import com.lzw.breezeNovel.common.result.Result;
import com.lzw.breezeNovel.model.entity.query.PaginationResultQuery;
import com.lzw.breezeNovel.webApp.service.video.MovieService;
import com.lzw.breezeNovel.webApp.vo.video.MovieVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.webApp.controller.video
 * @date 2025/3/18
 * @description 电影
 */

@RestController
@RequestMapping("/app/movie")
@SuppressWarnings("all")
public class MovieController {

    /**
     * 注入service
     */
    @Autowired
    private MovieService movieService;

    /**
     * 电影列表
     */
    @GetMapping("/getMovie")
    public Result<PaginationResultQuery<MovieVo>> getMovie(@RequestParam int page, @RequestParam int size) {
        PaginationResultQuery<MovieVo> movieVoPaginationResultQuery = movieService.getMovie(page, size);
        return  Result.ok(movieVoPaginationResultQuery);
    }

    /**
     * 获取相关类型的电影
     */
    @GetMapping("/getMovieByType")
    public Result<List<MovieVo>> getMovieByType(@RequestParam String type, @RequestParam Integer videoId) {
        List<MovieVo> movieVoList = movieService.getMovieByType(type, videoId);
        return Result.ok(movieVoList);
    }

}
